Skip to content

Fix #1946: check-timeout tests tell a late Windows kill from no kill - #1947

Merged
amrmelsayed merged 8 commits into
mainfrom
builder/bugfix-1946
Nov 22, 2026
Merged

amrmelsayed merged 8 commits into
mainfrom
builder/bugfix-1946

Conversation

@amrmelsayed

@amrmelsayed amrmelsayed commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

The three bugfix-1814-check-timeout timeout tests failed on native Windows under full-suite load: a 3s sleep under a 300ms timeout was bounded at 2500ms, and a slow Windows teardown made a late kill indistinguishable from no kill. Test-only fix; porch's timeout behaviour is unchanged.

Fixes #1946

Root Cause

On Windows a timed-out check is torn down by a fresh census, a job termination and a taskkill, each its own process launch. Under load that takes ~3s. Reproduced with synthetic load (busy CPU workers plus constant process launches), 300ms timeout:

command durations
sleep 3 4454, 3429, 3187 ms (fail the 2500ms bound)
sleep 30 2905, 3199, 3434 ms

So the kill lands late, it does not fail to land, and there's no product bug. With a 3s sleep the command could finish on its own inside that window and still report "Timed out", because killed is set when the timer fires, so the 2500ms bound was not measuring the kill.

Fix

In packages/codev/src/commands/porch/__tests__/bugfix-1814-check-timeout.test.ts:

  • The three tests that used sleep 3 now use sleep 30 (SLOW_COMMAND).
  • Bound: 15000ms on win32 (half the sleep, ~4x the worst observed), 2500ms kept on POSIX (KILLED_WITHIN_MS). All three tests now assert it, along with the "Timed out after 0.3s" error.
  • Test timeout raised to 45s, so a check nobody killed fails on the bound at ~30s and doesn't hit a vitest timeout.

Test Plan

  • Regression evidence: with the timeout's killGroup calls removed from checks.ts (temporary, reverted), all three tests fail at ~30.1s against the 15s bound. With the kill in place, they pass.
  • File passes alone on native Windows.
  • Three consecutive full-suite runs on native Windows, one at a time: run 1 via porch done (build + tests passed first try), runs 2–3 npm test: 406 files passed / 9 skipped, 8110 tests passed / 247 skipped each.
  • Tower PID 53132 before and after every run; no change.
  • Linux CI green (all 8 checks, incl. Unit Tests and macOS).

No Windows workflow dispatch: no platform code is touched.

The three bugfix-1814 timeout tests slept 3s under a 300ms timeout and bounded
the check at 2500ms. On Windows the teardown (census, job termination, taskkill)
takes ~3s under full-suite load, so the sleep could finish on its own and still
report "Timed out". Sleep 30s instead, bound the check at 15s on win32 (2500ms on
POSIX), assert the bound in all three tests, and give them a 45s test timeout so a
check nobody killed fails on the bound. Test-only: porch's timeout behaviour is
unchanged. With the kill disabled, all three fail at ~30s against the 15s bound.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: bugfix-1814 check-timeout test fails under full-suite load; its 2500ms bound cannot tell a late kill from no kill

1 participant